Migrating from Cubeplan¶
Even though the way of creating and sharing apps is the same, Cubeplan models can not be run on Pyplan. Neither dashboards generated with Cubeplan can be exported and used in Pyplan. The origin of that lack of compatibility is that they run different languages underneath to calculate computations. It is an excellent exercise for learning Pyplan translating an old Cubeplan model.
Similarities¶
Pyplan organizes Python code through influence diagrams the same as Cubeplan. Nodes have a Title and an Identifier to call them from other nodes. You can also point and click a node to incorporate its Id when creating a formula. Navigating through the model works exactly the same, following inputs or outputs or by exploring the influence diagram. Nodes also include a documentation as in Cubeplan. Pyplan also includes “intelligent” matrix operations by adapting the usage of the Xarray python library
Differences¶
One of the most important conceptual difference of Pyplan is that a node can contain different type of objects (i.e. Pandas, Numpy, Xarray) This fact is one of the most important advantage of embracing Python language since you will be able to use specific purposes libraries that use different type of data structures and objects. Pyplan natively interprets the Pandas, Numpy and Xarray objects visualising its data as table or graphs with a single click. Libraries can be installed and used with any model. The model file registers libraries dependency to require instalment when shared with other users.
Functions equivalence list¶
Check the examples available in Pyplan Library folder to find how to do with Pyplan basic Cubeplan operations .
The following table contains Cubeplan basic function list and its equivalent in Pyplan.
Model | Title in Cubeplan | Pyplan Library | Node with example | PPL,XA or Pandas |
---|---|---|---|---|
Selecting Data from Array | change index | pp.change_index | change_index_ex /change_index_by_pos_ex | PPL |
Selecting Data from Array | subscript | pp.subscript | subscript_ex | PPL |
Selecting Data from Array | subscript looking up | pp.lookup | lookup_ex | PPL |
Selecting Data from Array | subset | pp.subset | subset_ex | PPL |
Selecting Data from Array | slice | pp.slice_dataarray | slice_dataarray_ex | PPL |
Basic Math and Missing Values | size | len() | len_size_ex | XA |
Basic Math and Missing Values | size | dataarray.size | len_size_ex | XA |
Basic Math and Missing Values | undef_filter | pp.fill_all | fillall_ex | PPL |
Basic Math and Missing Values | nvx_is_null/nvx_is_nan | dataarray.fillna() | missing_values_methodsfillna | XA |
Basic Math and Missing Values | undef_filter | pp.fill_inf | fillinf_ex | PPL |
Basic Math and Missing Values | min | dataarray.min() | min_along_indexes | XA |
Basic Math and Missing Values | max | dataarray.max() | max_along_indexes | XA |
Basic Math and Missing Values | if then else | xr.where | xr_where_exa | XA |
Basic Math and Missing Values | min_ | np.minimum | mini_maxi_among_2_dataarrays | XA |
Basic Math and Missing Values | max_ | np.maximum | pp_maximum | XA |
Aggregation and Rolling window operations | sum | dataarray.sum() | sum_ex | XA |
Aggregation and Rolling window operations | cumulate | dataarray.cumsum() | cumsum_ex | XA |
Aggregation and Rolling window operations | cumproduct | dataarray.cumprod() | cumprod_ex | XA |
Aggregation and Rolling window operations | backward looking sum | dataarray.rolling() | back_look_sum_example | XA |
Aggregation and Rolling window operations | filtered aggregate | pp.aggregate | aggregate_ex | PPL |
Working with Indexes | concat | pp.concat_index | concatindex_ex | PPL |
Working with Indexes | new | pp.add_periods | add_periods_ex | PPL |
Working with Indexes | new | pp.apply_fn | apply_fn_ex | PPL |
Working with Indexes | find in text | pp.find | find_ex | PPL |
Working with Indexes | splittext | pp.split_text | splittext_ex | PPL |
Dynamic NPV IRR and Linear Depreciation | npv | pp.npv | npv_ex | PPL |
Dynamic NPV IRR and Linear Depreciation | irr | pp.irr | irr_ex | PPL |
Dynamic NPV IRR and Linear Depreciation | dynamic | pp.dynamic | dynamic_ex | PPL |
Dynamic NPV IRR and Linear Depreciation | new | pp.create_time | time | PPL |
Dynamic NPV IRR and Linear Depreciation | linear depreciation | pp.linear_depreciation | linear_depreciation_ex | PPL |
Dynamic NPV IRR and Linear Depreciation | or | ¦ | NA | XA |
Reading Data from Excel | nvx_da_source_cone | pp.excel_connection | excel_connection_ex | PPL |
Reading Data from Excel | nvx_read_index | pp.index_from_excel | reading_example_index | PPL |
Reading Data from Excel | nvx_read_table | pp.dataarray_from_excel | dataarray_from_excel_ex | PPL |
Reading Data from Excel | nvx_read_table | pp.pandas_from_excel | pandas_from_excel_ex | PPL |
Interacting with Pandas | new | pd.read_csv | pd_read_csv | Pandas |
Interacting with Pandas | new | pp.index_from_pandas | orders_date | PPL |
Interacting with Pandas | new | reading from pandas (see example) | sales_data_by_orders_date | XA |
Financial Planning Library for Cubeplan users¶
If you are used to create financial planning models in Cubeplan then these other functions will be useful for you.
Contact your former Cubeplan distributor to ask for the module with these specific functions.
Module | Title in Cubeplan | Pyplan Library |
---|---|---|
Financial Planning | sea_to_time | sea_to_time |
Financial Planning | annualise | annualise |
Financial Planning | month | month |
Financial Planning | evatime | evatime |
Financial Planning | new | days_to_time |
Financial Planning | new | time_to_days |
Financial Planning | evayears | evayears |
Financial Planning | years to time | years_to_time |
Financial Planning | cascade_volume | cascade_volume |
Financial Planning | band_allocation | band_allocation |
Financial Planning | new | dispatch |
Financial Planning | new | nvx_read_multi_sheets |
Financial Planning | new | nvx_smart_pandas |
Financial Planning | new | nvx_round |
Financial Planning | new | nvx_safe_int_div |
Use these functions as you used them in Cubeplan.